package com.project.zsxd.server.article.controller;


import com.alibaba.fastjson.JSONObject;
import com.project.zsxd.server.annotation.LoginPass;
import com.project.zsxd.server.article.entity.Article;
import com.project.zsxd.server.article.service.IArticleService;
import com.project.zsxd.server.common.bean.Result;
import com.project.zsxd.server.tag.entity.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 文章表 前端控制器
 * </p>
 *
 * @author kaler
 * @since 2021-07-05
 */
@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private IArticleService articleService;

    @LoginPass
    @PostMapping("queryArticlesByType")
    public Result queryArticlesByType(@RequestBody JSONObject param) {
        List<Article> articles = articleService.queryArticlesByType(param.getString("articleType"));
        return Result.success(articles);
    }

}
